<script setup lang="ts">
import ChannelNav from './components/ChannelNav.vue';
import ArticleList from './components/ArticleList.vue'
import { ref } from 'vue';

// 定义频道ID信息
const changeID = ref(0)

// 父组件注册事件 接收子组件传递来的数据
const changeId = (id:number)=>{
  changeID.value = id
}
</script>

<template>
  <!-- 父组件向子组件传入ID数据  -->
  <ChannelNav :changeID="changeID" @changeChanID="changeId"></ChannelNav>
<!-- 父组件向子组件传入ID数据  -->
 <ArticleList :changeID="changeID"></ArticleList>

 <router-view></router-view>
</template>
